import Vue from 'vue'
import Router from 'vue-router'
import Login from '../views/Login'
import Register from "../views/Register";
import Home from '../views/Home'
import Institution_register from '../views/Institution_register'
//普通文件上传
import Fileupload from '../components/Fileupload';
//栅格数据上传
import Filexmlupload from '../components/Filexmlupload';

// import Bigfileupload from "../components/upload/Bigfileupload";
// import PictureUpload from "../components/upload/PictureUpload";
//import excelupload from "../components/upload/excelupload";
//文件下载
import Filedownload from "../components/Filedownload";
import FileBrowse from "../components/FileBrowse";
//地图
import FileBrowsemap from "../components/FileBrowsemap";

import main from "../components/main";


//数据服务sysm
import service2 from "../components/dataService/resultData/service";
import service from "../components/dataService/inputData/service";
//防洪抗旱
import serviceone from "../components/dataService/inputData/serviceone";
//河流水系
import servicetwo from "../components/dataService/inputData/servicetwo";
import servicethree from "../components/dataService/inputData/servicethree";
import servicefour from "../components/dataService/inputData/servicefour";
import servicefive from "../components/dataService/inputData/servicefive";
import servicesix from "../components/dataService/inputData/servicesix";
import serviceseven from "../components/dataService/inputData/serviceseven";
import serviceseight from "../components/dataService/inputData/serviceseight";
import servicesnine from "../components/dataService/inputData/servicesnine";
import servicesten from "../components/dataService/inputData/servicesten";

//历史上传
import historyupload from "../components/historyupload/historyupload";
//关于
import about from "../components/about/about";
//搜索
import search from "../components/search/search";
//形态管控
import formcontrol from "../components/formcontrol/formcontrol";

Vue.use(Router);

const routes = [
  {
    path:'/',
    redirect:'/login',
    meta: { title: '系统用户注册' }
  },
  {
    path:'/register',
    component: Register
  }, {
    path:'/login',
    component: Login
  }, {
    path:'/institution_register',
    component: Institution_register,
    meta: { title: '系统机构注册' }
  },
  {
    path:'/home',
    component:Home,
    children:[
      {
        path:'/components/fileupload', component:Fileupload
      },
      {
        path:'/components/Filexmlupload',
        component:Filexmlupload
      },
      {
        path:'/components/filedownload',
        component:Filedownload
      },
      {
        path:'/components/filebrowse',
        component:FileBrowse
      },
      {
        path:'/components/main',
        component:main
      },
      {
        path:'/components/historyupload/historyupload',
        component:historyupload
      },
      {
        path:'/components/about/about',
        component:about
      },
      {
        path:'/components/FileBrowsemap',
        component:FileBrowsemap
      },
      {
        path:'/components/search/search',
        component:search
      },
      {
        path:'/components/formcontrol/formcontrol',
        component:formcontrol,
        meta: { title: '形态管控专题' }
      },
      {
        path:'/components/formcontrol/groundClassification',
        component:()=> import('../components/formcontrol/groundClassification.vue'),
        meta: { title: '地物分类专题' }
      },
      {
        path:'/components/formcontrol/waterInversion',
        component:()=> import('../components/formcontrol/waterInversion.vue'),
        meta: { title: '水质反演专题' }
      },
      {
        path:'/components/dataService/service',
        component:service,
        children:[
          {
            path:'/components/dataService/serviceone',
            component:serviceone,
            meta: { title: '防洪抗旱' }
          },
          {
            path:'/components/dataService/servicetwo',
            component:servicetwo,
            meta: { title: '河流水系' }
          },
          {
            path:'/components/dataService/servicethree',
            component:servicethree,
            meta: { title: '水环境' }
          },
          {
            path:'/components/dataService/servicefour',
            component:servicefour,
            meta: { title: '水利工程' }
          },
          {
            path:'/components/dataService/servicefive',
            component:servicefive,
            meta: { title: '水文' }
          },
          {
            path:'/components/dataService/servicesix',
            component:servicesix,
            meta: { title: '水资源' }
          },
          {
            path:'/components/dataService/serviceseven',
            component:serviceseven,
            meta: { title: '统计年鉴' }
          },
          {
            path:'/components/dataService/serviceseight',
            component:serviceseight,
            meta: { title: '政策规划' }
          },
          {
            path:'/components/dataService/servicesnine',
            component:servicesnine,
            meta: { title: '地理空间' }
          },
          {
            path:'/components/dataService/servicesten',
            component:servicesten,
            meta: { title: '其他' }
          },
        ]
      },
      {
        path:'/components/dataService/service2',
        component:()=> import('../components/dataService/resultData/service'),
        children:[
          {
            path:'/components/dataService/service2one',
            component:()=> import('../components/dataService/resultData/serviceone'),
            meta: { title: '防洪抗旱' }
          },
          {
            path:'/components/dataService/service2two',
            component:()=> import('../components/dataService/resultData/servicetwo'),
            meta: { title: '河流水系' }
          },
          {
            path:'/components/dataService/service2three',
            component:()=> import('../components/dataService/resultData/servicethree'),
            meta: { title: '水环境' }
          },
          {
            path:'/components/dataService/service2four',
            component:()=> import('../components/dataService/resultData/servicefour'),
            meta: { title: '水利工程' }
          },
          {
            path:'/components/dataService/service2five',
            component:()=> import('../components/dataService/resultData/servicefive'),
            meta: { title: '水文' }
          },
          {
            path:'/components/dataService/service2six',
            component:()=> import('../components/dataService/resultData/servicesix'),
            meta: { title: '水资源' }
          },
          {
            path:'/components/dataService/service2seven',
            component:()=> import('../components/dataService/resultData/serviceseven'),
            meta: { title: '统计年鉴' }
          },
          {
            path:'/components/dataService/service2eight',
            component:()=> import('../components/dataService/resultData/serviceseight'),
            meta: { title: '政策规划' }
          },
          {
            path:'/components/dataService/service2nine',
            component:()=> import('../components/dataService/resultData/servicesnine'),
            meta: { title: '地理空间' }
          },
          {
            path:'/components/dataService/service2ten',
            component:()=> import('../components/dataService/resultData/servicesten'),
            meta: { title: '其他' }
          },
        ]
      },
    ]
  },
  {
    path:'/views/newSrc/newSystem',
    component:()=> import('../views/newSrc/index.vue'),
    meta: { title: '斧头湖流域河湖空间智慧管理系统' }
  },
  {
    path:'/views/newSrc/newSystem/formControl',
    component:()=> import('../views/newSrc/formControl/formControl'),
    meta: { title: '形态管控系统' },
    children:[
      {
        path: '/views/newSrc/newSystem/formControl',
        component:()=> import('../views/newSrc/formControl/index'),
        meta:{
          title:"形态管控系统",
          parentName:"",
          index:"1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/gan',
        component:()=> import('../views/newSrc/formControl/controlObject/river/gan'),
        meta:{
          title:"淦河",
          parentName:"",
          index:"1-2-1-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/jinshui',
        component:()=> import('../views/newSrc/formControl/controlObject/river/jinshui'),
        meta:{
          title:"金水河",
          parentName:"",
          index:"1-2-1-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/futouProtect',
        component:()=> import('../views/newSrc/formControl/controlObject/lake/futouProtect'),
        meta:{
          title:"斧头湖保护区",
          parentName:"",
          index:"1-2-1-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/futouControl',
        component:()=> import('../views/newSrc/formControl/controlObject/lake/futouControl'),
        meta:{
          title:"斧头湖控制区",
          parentName:"",
          index:"1-2-1-2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/luProtect',
        component:()=> import('../views/newSrc/formControl/controlObject/lake/luProtect'),
        meta:{
          title:"鲁湖保护区",
          parentName:"",
          index:"1-2-2-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/luControl',
        component:()=> import('../views/newSrc/formControl/controlObject/lake/luControl'),
        meta:{
          title:"鲁湖控制区",
          parentName:"",
          index:"1-2-2-2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/xiliangProtect',
        component:()=> import('../views/newSrc/formControl/controlObject/lake/xiliangProtect'),
        meta:{
          title:"西凉湖保护区",
          parentName:"",
          index:"1-2-3-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/xiliangControl',
        component:()=> import('../views/newSrc/formControl/controlObject/lake/xiliangControl'),
        meta:{
          title:"西凉湖控制区",
          parentName:"",
          index:"1-2-3-2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/nanchuan',
        component:()=> import('../views/newSrc/formControl/controlObject/shuiku/nanchuan'),
        meta:{
          title:"南川水库",
          parentName:"",
          index:"1-3-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/simenlou',
        component:()=> import('../views/newSrc/formControl/controlObject/shuiku/simenlou'),
        meta:{
          title:"四门楼水库",
          parentName:"",
          index:"1-3-2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlObject/mingshuiquan',
        component:()=> import('../views/newSrc/formControl/controlObject/shuiku/mingshuiquan'),
        meta:{
          title:"鸣水泉水库",
          parentName:"",
          index:"1-3-3",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlTech/techLine',
        component:()=> import('../views/newSrc/formControl/controlTech/techLine/techLine'),
        meta:{
          title:"技术路线",
          parentName:"",
          index:"2-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlTech/disturbance',
        component:()=> import('../views/newSrc/formControl/controlTech/disturbance/disturbance'),
        meta:{
          title:"扰动示例",
          parentName:"",
          index:"2-2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/formControl/controlTech/dynamic',
        component:()=> import('../views/newSrc/formControl/dynamic/dynamic'),
        meta:{
          title:"动态识别",
          parentName:"",
          index:"3-1",
          order:"0-1"
        }
      },
    ]
  },
  {
    path:'/views/newSrc/newSystem/waterControl',
    component:()=> import('../views/newSrc/waterControl/waterControl'),
    meta: { title: '水体管控系统' },
    children:[
      {
        path: '/views/newSrc/newSystem/waterControl',
        component:()=> import('../views/newSrc/waterControl/index'),
        meta:{
          title:"水体管控系统",
          parentName:"",
          index:"1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/waterControl/monitorObject/rainfallStation',
        component:()=> import('../views/newSrc/waterControl/monitorObject/rainfallStation'),
        meta:{
          title:"雨量站",
          parentName:"",
          index:"1-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/waterControl/monitorObject/hydroStation',
        component:()=> import('../views/newSrc/waterControl/monitorObject/hydroStation'),
        meta:{
          title:"水文站",
          parentName:"",
          index:"1-2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/waterControl/monitorObject/waterLevelStation',
        component:()=> import('../views/newSrc/waterControl/monitorObject/waterLevelStation'),
        meta:{
          title:"水位站",
          parentName:"",
          index:"1-3",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/waterControl/monitorObject/waterIntake',
        component:()=> import('../views/newSrc/waterControl/monitorObject/waterIntake'),
        meta:{
          title:"取水口",
          parentName:"",
          index:"1-4",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/waterControl/monitorObject/sewageOutlet',
        component:()=> import('../views/newSrc/waterControl/monitorObject/sewageOutlet'),
        meta:{
          title:"排污口",
          parentName:"",
          index:"1-5",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/waterControl/monitorObject/section',
        component:()=> import('../views/newSrc/waterControl/monitorObject/section'),
        meta:{
          title:"考核断面",
          parentName:"",
          index:"1-6",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/waterControl/monitorObject/query',
        component:()=> import('../views/newSrc/waterControl/monitorObject/query'),
        meta:{
          title:"信息查询",
          parentName:"",
          index:"1-7",
          order:"0-1"
        }
      },
    ]
  },
  {
    path:'/views/newSrc/newSystem/ecologicalControl',
    component:()=> import('../views/newSrc/ecologicalControl/ecologicalControl'),
    meta: { title: '生态管控系统' },
    children:[
      {
        path: '/views/newSrc/newSystem/ecologicalControl',
        component:()=> import('../views/newSrc/ecologicalControl/index'),
        meta:{
          title:"生态管控系统",
          parentName:"",
          index:"1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/waterConservation/jianghan',
        component:()=> import('../views/newSrc/ecologicalControl/controlObject/waterConversation/jianghan'),
        meta:{
          title:"江汉平原水土保持分区",
          parentName:"",
          index:"1-1-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/waterConservation/mufu',
        component:()=> import('../views/newSrc/ecologicalControl/controlObject/waterConversation/mufu'),
        meta:{
          title:"幕府平原水土保持分区",
          parentName:"",
          index:"1-1-2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/redLine/park',
        component:()=> import('../views/newSrc/ecologicalControl/controlObject/redLine/park'),
        meta:{
          title:"国家公园",
          parentName:"",
          index:"1-2-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/redLine/watersource',
        component:()=> import('../views/newSrc/ecologicalControl/controlObject/redLine/watersource'),
        meta:{
          title:"引用水源地",
          parentName:"",
          index:"1-2-2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/redLine/reserve',
        component:()=> import('../views/newSrc/ecologicalControl/controlObject/redLine/reserve'),
        meta:{
          title:"自然保护区",
          parentName:"",
          index:"1-2-3",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/controlTech',
        component:()=> import('../views/newSrc/ecologicalControl/controlTech/index'),
        meta:{
          title:"管控技术",
          parentName:"",
          index:"2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/controlPart/soilErosion',
        component:()=> import('../views/newSrc/ecologicalControl/controlPart/soilErosion'),
        meta:{
          title:"水土流失强度",
          parentName:"",
          index:"3-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/controlPart/fragility',
        component:()=> import('../views/newSrc/ecologicalControl/controlPart/fragility/fragility'),
        meta:{
          title:"生态脆弱程度",
          parentName:"",
          index:"3-2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/controlPart/artifical/2019',
        component:()=> import('../views/newSrc/ecologicalControl/controlPart/artifical/artifical2019'),
        meta:{
          title:"人为扰动识别",
          parentName:"",
          index:"3-3-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/controlPart/artifical/202001',
        component:()=> import('../views/newSrc/ecologicalControl/controlPart/artifical/artifical202001'),
        meta:{
          title:"人为扰动识别",
          parentName:"",
          index:"3-3-2",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/controlPart/artifical/202006',
        component:()=> import('../views/newSrc/ecologicalControl/controlPart/artifical/artifical202006'),
        meta:{
          title:"人为扰动识别",
          parentName:"",
          index:"3-3-3",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/controlPart/partition/yiban',
        component:()=> import('../views/newSrc/ecologicalControl/controlPart/partition/yiban'),
        meta:{
          title:"陆域一般管控区",
          parentName:"",
          index:"3-4-1",
          order:"0-1"
        }
      },
      {
        path: '/views/newSrc/newSystem/ecologicalControl/controlPart/partition/zhongdian',
        component:()=> import('../views/newSrc/ecologicalControl/controlPart/partition/zhongdian'),
        meta:{
          title:"陆域重点管控区",
          parentName:"",
          index:"3-4-2",
          order:"0-1"
        }
      },
    ]
  },
  {
    path:'/views/newSrc/newSystem/controlStandard',
    component:()=> import('../views/newSrc/controlStandard/controlStandard'),
    meta: { title: '管控标准' },
    children:[
      {
        path: '/views/newSrc/newSystem/controlStandard/totalWater',
        component:()=> import('../views/newSrc/controlStandard/redLine/totalWater'),
        meta:{
          title:"用水总量控制目标",
          parentName:"",
          index:"1-1",
          order:"0-1"
        }
      },

    ]
  },
];
const router = new Router({
  routes
})
/*
router.beforeEach((to, from, next) => {
  if(to.path !=="/login"){
    if(!sessionStorage.getItem('username')){
      return next("/login")
    }
  }
  next()
})
*/
export default router;

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}
